home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / procmap.h.z / procmap.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  3.0 KB  |  111 lines

  1. /* $Id: procmap.h,v 1.8 1999/02/23 11:43:06 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_PROC_MAP_H__
  25. #define __GLIBTOP_PROC_MAP_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/global.h>
  29.  
  30. BEGIN_LIBGTOP_DECLS
  31.  
  32. #define GLIBTOP_PROC_MAP_NUMBER        0
  33. #define GLIBTOP_PROC_MAP_TOTAL        1
  34. #define GLIBTOP_PROC_MAP_SIZE        2
  35.  
  36. #define GLIBTOP_MAX_PROC_MAP        3
  37.  
  38. #define GLIBTOP_MAP_ENTRY_START        1
  39. #define GLIBTOP_MAP_ENTRY_END        2
  40. #define GLIBTOP_MAP_ENTRY_OFFSET    3
  41. #define GLIBTOP_MAP_ENTRY_PERM        4
  42. #define GLIBTOP_MAP_ENTRY_INODE        5
  43. #define GLIBTOP_MAP_ENTRY_DEVICE    6
  44. #define GLIBTOP_MAP_ENTRY_FILENAME    7
  45.  
  46. #define GLIBTOP_MAX_MAP_ENTRY        8
  47.  
  48. #define GLIBTOP_MAP_FILENAME_LEN    215
  49.  
  50. #define GLIBTOP_MAP_PERM_READ        1
  51. #define GLIBTOP_MAP_PERM_WRITE        2
  52. #define GLIBTOP_MAP_PERM_EXECUTE    4
  53. #define GLIBTOP_MAP_PERM_SHARED        8
  54. #define GLIBTOP_MAP_PERM_PRIVATE    16
  55.  
  56. typedef struct _glibtop_map_entry    glibtop_map_entry;
  57.  
  58. typedef struct _glibtop_proc_map    glibtop_proc_map;
  59.  
  60. struct _glibtop_map_entry
  61. {
  62.     u_int64_t flags, start, end, offset, perm, inode, device;
  63.     char filename [GLIBTOP_MAP_FILENAME_LEN+1];
  64. };
  65.  
  66. struct _glibtop_proc_map
  67. {
  68.     u_int64_t    flags,
  69.         number,            /* GLIBTOP_PROC_MAP_NUMBER    */
  70.         total,            /* GLIBTOP_PROC_MAP_TOTAL    */
  71.         size;            /* GLIBTOP_PROC_MAP_SIZE    */
  72. };
  73.  
  74. #define glibtop_get_proc_map(proc_map,pid) glibtop_get_proc_map_l(glibtop_global_server, proc_map, pid)
  75.  
  76. #if GLIBTOP_SUID_PROC_MAP
  77. #define glibtop_get_proc_map_r        glibtop_get_proc_map_p
  78. #else
  79. #define glibtop_get_proc_map_r        glibtop_get_proc_map_s
  80. #endif
  81.  
  82. glibtop_map_entry *
  83. glibtop_get_proc_map_l (glibtop *server, glibtop_proc_map *buf, pid_t pid);
  84.  
  85. #if GLIBTOP_SUID_PROC_MAP
  86. void glibtop_init_proc_map_p (glibtop *server);
  87.  
  88. glibtop_map_entry *
  89. glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid);
  90. #else
  91. void glibtop_init_proc_map_s (glibtop *server);
  92.  
  93. glibtop_map_entry *
  94. glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid);
  95. #endif
  96.  
  97. #ifdef GLIBTOP_NAMES
  98.  
  99. /* You need to link with -lgtop_names to get this stuff here. */
  100.  
  101. extern const char *glibtop_names_proc_map [];
  102. extern const unsigned glibtop_types_proc_map [];
  103. extern const char *glibtop_labels_proc_map [];
  104. extern const char *glibtop_descriptions_proc_map [];
  105.  
  106. #endif
  107.  
  108. END_LIBGTOP_DECLS
  109.  
  110. #endif
  111.